package com.yanqu.road.server.cmd.activity.horserun;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.HorseRunProto;
import com.yanqu.road.server.cmd.CrossUnionCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.logic.MessageHelper;
import com.yanqu.road.server.manager.activity.horserun.CrossHorseRunActivity;
import com.yanqu.road.server.manager.activity.horserun.CrossHorseRunMgr;
import com.yanqu.road.server.protocol.ClientProtocol;
import com.yanqu.road.server.protocol.CrossProtocol;
import com.yanqu.road.server.protocol.GameErrorCode;
import com.yanqu.road.utils.YanQuMessageUtils;

@Cmd(code = CrossProtocol.C_HORSE_RUN_UPLOAD_BRIEF_HORSE_DATA,desc = "上传小马信息")
public class CrossHorseRunUploadHorseCmd extends CrossUnionCommand {
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        HorseRunProto.HorseRunUploadDataToCrossMsg upload = HorseRunProto.HorseRunUploadDataToCrossMsg.parseFrom(packet.getBytes());
        CrossHorseRunActivity activity = CrossHorseRunMgr.getActivity(upload.getActivityId(), groupId);
        if (activity == null) {
            return;
        }
        activity.uploadUserData(upload.getUserId(),upload.getBriefData());
    }

    @Override
    public void sendData() {

    }
}
